package com.uduemc.biso.core.utils;

import java.math.BigDecimal;
import java.util.UUID;

public class NumberUUId {

	public static String getAccountIdByUUId() {
		int machineId = 1;
		int hashCodeV = UUID.randomUUID().toString().hashCode();
		if (hashCodeV < 0) {
			hashCodeV = -hashCodeV;
		}
		return machineId + String.format("%015d", hashCodeV);
	}

	public static String getNumberIdByUUId(long userId) {
		long random = (long) ((Math.random() * 9 + 1) * 10000);
		String authKeyDom = String.valueOf(System.currentTimeMillis() / random) + String.valueOf(userId);
		Decimal52 decimal52 = new Decimal52();
		BigDecimal bigDecimal = new BigDecimal(authKeyDom);
		String authKey = decimal52.getDecimal(bigDecimal);
		return authKey.toLowerCase();
	}

	public static String getNumberIdByUUId() {
		long random = (long) ((Math.random() * 9 + 1) * 10000);
		String authKeyDom = String.valueOf(System.currentTimeMillis() / random);
		Decimal52 decimal52 = new Decimal52();
		BigDecimal bigDecimal = new BigDecimal(authKeyDom);
		String authKey = decimal52.getDecimal(bigDecimal);
		return authKey.toLowerCase();
	}
}
